package com.honglv.controller.admin;

import com.honglv.pojo.dto.UploadFoodDTO;
import com.honglv.pojo.dto.UploadFoodDTO;
import com.honglv.pojo.result.Result;
import com.honglv.service.FoodService;
import com.honglv.service.FoodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("adminFoodController")
@Slf4j
@RequestMapping("/admin")
@Api("美食相关接口")
public class FoodController {
    @Autowired
    private FoodService foodService;

    /**
     * 管理员上传美食
     * @param
     * @return
     */
    @PostMapping("/uploadFood")
    @ApiOperation("上传美食")
    public Result uploadFood(@RequestBody UploadFoodDTO uploadFoodDTO){
        foodService.upload(uploadFoodDTO);
        return Result.success();
    }


}

